package com.yima.baseproj.config.exception.type;

import com.yima.baseproj.module.config.utils.ResultCodeE;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * api异常
 * @Author 一码
 * @createDate 2023/4/1 09:00
 * @contact 1424529270@qq.com
 */
@Data
@NoArgsConstructor
public class ApiException extends RuntimeException {

    public ApiException(String msg) {
        super(msg);
    }

    public static ApiException getInstance(String msg){
        return new ApiException(msg);
    }

    public static ApiException getInstance(){
        return new ApiException(ResultCodeE.DATA_FAIL.getDes());
    }
}
